// const router = require('koa-router')()
// router.prefix('/chapter');
// router.get('/', async (ctx, next) => {
//     let chapterList = [
//         {
//             title: '文章标题',
//             author: '张三',
//             timer: '2019-08-19'
//         },

//     ]
//     await ctx.render('chapterList', {
//         sourpath: "http://192.168.174.166:3000/"
//     })
// })

// router.get('/detail', async (ctx, next) => {
//     await ctx.render('chapter', {

//     })
// })

// module.exports = router

const router = require('koa-router')()
router.prefix('/chapter')

router.get('/', async (ctx, next) => {
    let chapterList = [
        {
            title: "文章标题1",
            author: "zhangsan",
            timer: "2019-08-19"
        }, {
            title: "文章标题2",
            author: "lisi",
            timer: "2019-08-19"

        }
    ]
    await ctx.render('chapterList', {
        sourpath: "http://192.168.174.166:3000/",
        chapterList: chapterList
    })
})

router.get('/datail', async (ctx, next) => {
    await ctx.render('chapter')
})

module.exports = router
